#!/bin/sh

INSTALLATION_PATH=$1
CAT_HOME=$2
TEMP_DIRECTORY=$INSTALLATION_PATH/work
NAME=$CAT_HOME/webapps/qudex-servlet/WEB-INF/classes/$HOSTNAME.config.xml
echo $NAME > $TEMP_DIRECTORY/output.txt
#Create a folder in the webapps directory
mkdir $CAT_HOME/webapps/qudex-servlet/
#Unzip the application in the newly created folder
#unzip $TEMP_DIRECTORY/qudex-servlet.war -d $CAT_HOME/webapps/qudex-servlet/
cp -R $TEMP_DIRECTORY/qudex-servlet/ $CAT_HOME/webapps/qudex-servlet/
cp $CAT_HOME/webapps/qudex-servlet/WEB-INF/classes/jfig.config.xml $NAME
rm -f $CAT_HOME/webapps/qudex-servlet/WEB-INF/classes/jfig.config.xml
echo $? >> $TEMP_DIRECTORY/output.txt
exit $?
